#pragma once
#ifndef TURRET_H
#define TURRET_H

#include <system/application.h>
#include <vector>
#include <iostream>
#include <math.h>

#include "GameObject.h"
#include "Gun.h"
#include "Enemy.h"

//-- This class defines turrets that can be created by the player
class Turret : public GameObject{
public:

	Turret();
	~Turret();

	void Update(abfw::Matrix44 marker, abfw::Matrix44 enemyOrigin, std::vector<Enemy> theEnemies);
	void Draw(abfw::Renderer3D* render3D);
	void DrawBullets(abfw::Renderer3D* render3D);
	void Fire(abfw::Mesh* mesh, abfw::Matrix44 marker);

	void SetAssignedMarker(int marker);

	bool CanFire();

	Gun* GetGun();

	float GetRotationZ();

	int GetAssignedMarker();
	
private:
	int mShootTimer;
	float mTargetRotation;
	abfw::Vector3 mDistance;

	Gun mGun;

	bool mCanFire;

	int mAssignedMarker;


};

#endif